package org.springleaf.utils;

import org.hibernate.cfg.ImprovedNamingStrategy;
import org.hibernate.cfg.NamingStrategy;

public class MyNamingStrategy extends ImprovedNamingStrategy implements
		NamingStrategy {

	private static final long serialVersionUID = 1L;

	private String tablePrefix;
	private String columnPrefix;

	/**
	 * 表名生成策略
	 */
	@Override
	public String classToTableName(String className) {

		return tablePrefix + tableName(className);
	}

	public String getTablePrefix() {
		return tablePrefix;
	}

	public void setTablePrefix(String tablePrefix) {
		this.tablePrefix = tablePrefix;
	}

	public String getColumnPrefix() {
		return columnPrefix;
	}

	public void setColumnPrefix(String columnPrefix) {
		this.columnPrefix = columnPrefix;
	}

	/**
	 * 字段名大写策略
	 */
	// @Override
	// public String propertyToColumnName(String propertyName) {
	// return addUnderscores(propertyName).toUpperCase();
	// }

}
